home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 1419 < prev    next >
Encoding:
Internet Message Format  |  1996-08-06  |  1.0 KB

  1. Path: locutus.rchland.ibm.com!usenet
  2. From: pstaite@vnet.ibm.com
  3. Newsgroups: comp.lang.c++
  4. Subject: Re: Inline function problem
  5. Date: 10 Jan 1996 21:55:52 GMT
  6. Organization: IBM OS/2 Device Driver Development  Rochester, MN
  7. Message-ID: <4d1cl8$qg5@locutus.rchland.ibm.com>
  8. References: <4d10i5$bc3@newsroom.hitc.com>
  9. Reply-To: pstaite@vnet.ibm.com
  10. NNTP-Posting-Host: warpone.rchland.ibm.com
  11. X-Newsreader: IBM NewsReader/2 v1.2
  12.  
  13. Try including foo.C in main.C instead of foo.H.  This way main.C "sees" 
  14. the definition (body) of the inline function.
  15.  
  16. A slightly less ugly approach is to put the inline functions in the .H 
  17. file at the end of the declarations.  Another idea is to put the inlines
  18. in a .inl file and include that at the end of the .H file.  That way, 
  19. any file that "sees" the declaration of the class can also "see" the 
  20. code for the inlines.  Otherwise, the compiler would have to be a mind 
  21. reader to know what to put in main.C. :-))
  22.  
  23. Phil Staite, team OS/2
  24. internet: pstaite@vnet.ibm.com  internal: pstaite@rchland
  25.  
  26.